package kr.co.fashionmai.controller;

import kr.co.fashionmai.service.FrontService;
import kr.co.fashionmai.vo.Member;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class FroxyController 
{
	
	private FrontService frontService;
	
	public void setFrontService(FrontService frontService)
	{
		this.frontService = frontService;
	}
	
	@RequestMapping(value="login.do")
	public ModelAndView checkLogin(Member member)
	{
		ModelAndView modelAndView = new ModelAndView();
		Member resultMember = null;
		
		resultMember = frontService.checkLogion(member);
		
		if(resultMember == null || !member.getPw().equals(resultMember.getPw()))
			modelAndView.setViewName("loginFail");
		else
			modelAndView.setViewName("loginSuccess");
		return modelAndView;
	}
	
	@RequestMapping(value="firstPage.do")
	public String firstPage()
	{
		return "loginSuccess";
	}
}
